<template>
  <div class="product-page">
    <!-- 页面头部 -->
    <section class="page-header">
      <div class="container">
        <div class="header-content">
          <h1 class="page-title">产品中心</h1>
          <p class="page-description">
            专业的软件产品矩阵，为不同行业和场景提供完整的解决方案
          </p>
        </div>
      </div>
    </section>

    <!-- 产品分类导航 -->
    <section class="product-categories">
      <div class="container">
        <div class="category-tabs">
          <div 
            class="category-tab" 
            v-for="category in productCategories" 
            :key="category.id"
            :class="{ active: selectedCategory === category.id }"
            @click="selectCategory(category.id)"
          >
            <div class="tab-icon">
              <el-icon><component :is="category.icon" /></el-icon>
            </div>
            <span class="tab-name">{{ category.name }}</span>
            <span class="tab-count">({{ category.count }})</span>
          </div>
        </div>
      </div>
    </section>

    <!-- 产品列表 -->
    <section class="products-section">
      <div class="container">
        <!-- 搜索和筛选 -->
        <div class="products-filter">
          <div class="search-box">
            <el-input
              v-model="searchKeyword"
              placeholder="搜索产品名称或功能特性"
              prefix-icon="Search"
              size="large"
              clearable
              @input="handleSearch"
            />
          </div>
          <div class="filter-options">
            <el-select v-model="sortBy" placeholder="排序方式" size="large">
              <el-option label="最新发布" value="latest" />
              <el-option label="最受欢迎" value="popular" />
              <el-option label="价格升序" value="price-asc" />
              <el-option label="价格降序" value="price-desc" />
            </el-select>
          </div>
        </div>

        <!-- 产品网格 -->
        <div class="products-grid" v-if="filteredProducts.length > 0">
          <div 
            class="product-card" 
            v-for="product in filteredProducts" 
            :key="product.id"
            @click="viewProductDetail(product.id)"
          >
            <div class="product-image">
              <img :src="product.image" :alt="product.name" />
              <div class="product-badges">
                <span class="badge" v-if="product.isNew">新品</span>
                <span class="badge hot" v-if="product.isHot">热门</span>
                <span class="badge recommended" v-if="product.isRecommended">推荐</span>
              </div>
            </div>
            <div class="product-content">
              <div class="product-header">
                <h3 class="product-name">{{ product.name }}</h3>
                <div class="product-rating">
                  <el-rate v-model="product.rating" disabled size="small" />
                  <span class="rating-text">({{ product.reviews }})</span>
                </div>
              </div>
              <p class="product-description">{{ product.description }}</p>
              <div class="product-features">
                <span class="feature-tag" v-for="feature in product.features.slice(0, 3)" :key="feature">
                  {{ feature }}
                </span>
                <span class="more-features" v-if="product.features.length > 3">
                  +{{ product.features.length - 3 }}更多
                </span>
              </div>
              <div class="product-footer">
                <div class="product-price">
                  <span class="price-label">起价</span>
                  <span class="price-value">¥{{ product.price }}</span>
                  <span class="price-unit">/月</span>
                </div>
                <div class="product-actions">
                  <el-button size="small" @click.stop="tryProduct(product.id)">
                    免费试用
                  </el-button>
                  <el-button type="primary" size="small" @click.stop="viewProductDetail(product.id)">
                    了解详情
                  </el-button>
                </div>
              </div>
            </div>
          </div>
        </div>

        <!-- 空状态 -->
        <div class="empty-state" v-else>
          <el-empty description="暂无相关产品" />
        </div>
      </div>
    </section>

    <!-- 产品详情弹窗 -->
    <el-dialog 
      v-model="showProductDetail" 
      :title="selectedProduct?.name" 
      width="80%"
      class="product-detail-dialog"
    >
      <div class="product-detail" v-if="selectedProduct">
        <div class="detail-content">
          <div class="detail-left">
            <div class="product-gallery">
              <img :src="selectedProduct.image" :alt="selectedProduct.name" class="main-image" />
              <div class="thumbnail-list">
                <img 
                  v-for="(img, index) in selectedProduct.gallery" 
                  :key="index"
                  :src="img" 
                  :alt="`${selectedProduct.name} ${index + 1}`"
                  class="thumbnail"
                />
              </div>
            </div>
          </div>
          <div class="detail-right">
            <div class="product-info">
              <div class="product-meta">
                <span class="category-tag">{{ getCategoryName(selectedProduct.categoryId) }}</span>
                <div class="product-rating">
                  <el-rate v-model="selectedProduct.rating" disabled />
                  <span class="rating-text">({{ selectedProduct.reviews }} 评价)</span>
                </div>
              </div>
              <h2 class="product-title">{{ selectedProduct.name }}</h2>
              <p class="product-summary">{{ selectedProduct.summary }}</p>
              
              <!-- 核心功能 -->
              <div class="core-features">
                <h3 class="features-title">核心功能</h3>
                <div class="features-list">
                  <div class="feature-item" v-for="feature in selectedProduct.coreFeatures" :key="feature.name">
                    <div class="feature-icon">
                      <el-icon><component :is="feature.icon" /></el-icon>
                    </div>
                    <div class="feature-content">
                      <h4 class="feature-name">{{ feature.name }}</h4>
                      <p class="feature-desc">{{ feature.description }}</p>
                    </div>
                  </div>
                </div>
              </div>

              <!-- 技术规格 -->
              <div class="tech-specs">
                <h3 class="specs-title">技术规格</h3>
                <div class="specs-grid">
                  <div class="spec-item" v-for="spec in selectedProduct.techSpecs" :key="spec.name">
                    <span class="spec-name">{{ spec.name }}</span>
                    <span class="spec-value">{{ spec.value }}</span>
                  </div>
                </div>
              </div>

              <!-- 价格方案 -->
              <div class="pricing-plans">
                <h3 class="pricing-title">价格方案</h3>
                <div class="plans-grid">
                  <div 
                    class="plan-card" 
                    v-for="plan in selectedProduct.pricingPlans" 
                    :key="plan.name"
                    :class="{ recommended: plan.recommended }"
                  >
                    <div class="plan-header">
                      <h4 class="plan-name">{{ plan.name }}</h4>
                      <div class="plan-price">
                        <span class="price">¥{{ plan.price }}</span>
                        <span class="period">/{{ plan.period }}</span>
                      </div>
                    </div>
                    <ul class="plan-features">
                      <li v-for="feature in plan.features" :key="feature">
                        <el-icon><Check /></el-icon>
                        {{ feature }}
                      </li>
                    </ul>
                    <el-button 
                      :type="plan.recommended ? 'primary' : 'default'" 
                      class="plan-button"
                      @click="selectPlan(plan)"
                    >
                      {{ plan.buttonText }}
                    </el-button>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <template #footer>
        <div class="dialog-footer">
          <el-button @click="showProductDetail = false">关闭</el-button>
          <el-button type="primary" @click="contactSales">
            联系销售
          </el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup lang="ts">
import { ref, computed, onMounted, watch } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import {
  OfficeBuilding,
  DataAnalysis,
  CloudyAndSunny,
  MobilePhone,
  Shield,
  Setting,
  Monitor,
  TrendCharts,
  Check,
  Search
} from '@element-plus/icons-vue'

const router = useRouter()
const route = useRoute()

// 响应式数据
const selectedCategory = ref('all')
const searchKeyword = ref('')
const sortBy = ref('latest')
const showProductDetail = ref(false)
const selectedProduct = ref<any>(null)

// 产品分类
const productCategories = [
  { id: 'all', name: '全部产品', icon: 'OfficeBuilding', count: 12 },
  { id: 'enterprise', name: '企业管理', icon: 'OfficeBuilding', count: 4 },
  { id: 'data', name: '数据分析', icon: 'DataAnalysis', count: 3 },
  { id: 'cloud', name: '云计算', icon: 'CloudyAndSunny', count: 2 },
  { id: 'mobile', name: '移动应用', icon: 'MobilePhone', count: 3 }
]

// 产品数据
const products = [
  {
    id: 46,
    name: '企业资源管理系统',
    categoryId: 'enterprise',
    description: '全面的企业资源管理解决方案，提升管理效率和决策质量',
    summary: '集成财务、人力、供应链、客户关系等核心业务模块的一体化管理平台',
    image: '/images/products/erp-system.jpg',
    gallery: ['/images/products/erp-1.jpg', '/images/products/erp-2.jpg', '/images/products/erp-3.jpg'],
    features: ['财务管理', '人力资源', '供应链', '客户关系', '项目管理', '报表分析'],
    price: 2999,
    rating: 4.8,
    reviews: 156,
    isNew: false,
    isHot: true,
    isRecommended: true,
    coreFeatures: [
      {
        name: '财务管理',
        description: '完整的财务核算、预算管理、成本控制体系',
        icon: 'TrendCharts'
      },
      {
        name: '人力资源',
        description: '员工档案、薪酬管理、绩效考核、招聘管理',
        icon: 'OfficeBuilding'
      },
      {
        name: '供应链管理',
        description: '采购、库存、销售、物流全链条管理',
        icon: 'Setting'
      },
      {
        name: '数据分析',
        description: '多维度数据分析，智能报表，决策支持',
        icon: 'DataAnalysis'
      }
    ],
    techSpecs: [
      { name: '部署方式', value: '云端/本地' },
      { name: '用户数量', value: '不限' },
      { name: '数据存储', value: '无限制' },
      { name: '技术支持', value: '7x24小时' }
    ],
    pricingPlans: [
      {
        name: '基础版',
        price: 2999,
        period: '月',
        features: ['基础财务管理', '员工档案管理', '基础报表', '邮件支持'],
        buttonText: '立即购买',
        recommended: false
      },
      {
        name: '专业版',
        price: 5999,
        period: '月',
        features: ['完整财务管理', '人力资源管理', '供应链管理', '高级报表', '电话支持'],
        buttonText: '立即购买',
        recommended: true
      },
      {
        name: '企业版',
        price: 9999,
        period: '月',
        features: ['全功能模块', '定制开发', '数据分析', '专属客服', '现场支持'],
        buttonText: '联系销售',
        recommended: false
      }
    ]
  },
  {
    id: 44,
    name: '智能数据分析平台',
    categoryId: 'data',
    description: '基于AI的数据分析与可视化平台，助力数据驱动决策',
    summary: '集数据采集、清洗、分析、可视化于一体的智能数据分析平台',
    image: '/images/products/data-platform.jpg',
    gallery: ['/images/products/data-1.jpg', '/images/products/data-2.jpg', '/images/products/data-3.jpg'],
    features: ['数据采集', '实时分析', '可视化', '预测模型', 'AI算法', '自动报告'],
    price: 1999,
    rating: 4.6,
    reviews: 89,
    isNew: true,
    isHot: false,
    isRecommended: true,
    coreFeatures: [
      {
        name: '数据采集',
        description: '支持多种数据源，自动化数据采集和清洗',
        icon: 'DataAnalysis'
      },
      {
        name: '实时分析',
        description: '实时数据处理，秒级响应分析结果',
        icon: 'TrendCharts'
      },
      {
        name: '智能可视化',
        description: '拖拽式图表设计，丰富的可视化组件',
        icon: 'Monitor'
      },
      {
        name: 'AI预测',
        description: '机器学习算法，智能预测和推荐',
        icon: 'CloudyAndSunny'
      }
    ],
    techSpecs: [
      { name: '数据处理', value: '实时/批量' },
      { name: '数据源', value: '50+种' },
      { name: '并发用户', value: '1000+' },
      { name: 'API接口', value: 'RESTful' }
    ],
    pricingPlans: [
      {
        name: '标准版',
        price: 1999,
        period: '月',
        features: ['基础数据分析', '标准图表', '5个数据源', '邮件支持'],
        buttonText: '免费试用',
        recommended: false
      },
      {
        name: '专业版',
        price: 3999,
        period: '月',
        features: ['高级分析', '自定义图表', '无限数据源', 'AI预测', '电话支持'],
        buttonText: '立即购买',
        recommended: true
      }
    ]
  },
  {
    id: 43,
    name: '云计算服务平台',
    categoryId: 'cloud',
    description: '弹性云计算解决方案，降低IT成本，提升业务敏捷性',
    summary: '提供计算、存储、网络、安全等全方位云服务',
    image: '/images/products/cloud-platform.jpg',
    gallery: ['/images/products/cloud-1.jpg', '/images/products/cloud-2.jpg'],
    features: ['弹性计算', '对象存储', '负载均衡', '自动扩缩', '安全防护', '监控告警'],
    price: 999,
    rating: 4.7,
    reviews: 234,
    isNew: false,
    isHot: true,
    isRecommended: false,
    coreFeatures: [
      {
        name: '弹性计算',
        description: '按需分配计算资源，支持自动扩缩容',
        icon: 'CloudyAndSunny'
      },
      {
        name: '数据存储',
        description: '高可用对象存储，支持多种存储类型',
        icon: 'DataAnalysis'
      },
      {
        name: '网络服务',
        description: '负载均衡、CDN加速、VPC网络',
        icon: 'Setting'
      },
      {
        name: '安全防护',
        description: '多层安全防护，DDoS防护，数据加密',
        icon: 'Shield'
      }
    ],
    techSpecs: [
      { name: '可用性', value: '99.99%' },
      { name: '数据中心', value: '全球多地' },
      { name: '扩展性', value: '无限扩展' },
      { name: '计费方式', value: '按量付费' }
    ],
    pricingPlans: [
      {
        name: '基础版',
        price: 999,
        period: '月',
        features: ['2核4G服务器', '100G存储', '100G流量', '基础监控'],
        buttonText: '立即开通',
        recommended: false
      },
      {
        name: '标准版',
        price: 2999,
        period: '月',
        features: ['4核8G服务器', '500G存储', '500G流量', '高级监控', '负载均衡'],
        buttonText: '立即开通',
        recommended: true
      }
    ]
  },
  {
    id: 42,
    name: '移动办公应用',
    categoryId: 'mobile',
    description: '全功能移动办公解决方案，随时随地高效办公',
    summary: '集成OA、CRM、项目管理等功能的移动办公平台',
    image: '/images/products/mobile-app.jpg',
    gallery: ['/images/products/mobile-1.jpg', '/images/products/mobile-2.jpg'],
    features: ['移动审批', '在线会议', '文档协作', '考勤打卡', '即时通讯', '任务管理'],
    price: 99,
    rating: 4.5,
    reviews: 567,
    isNew: false,
    isHot: false,
    isRecommended: false,
    coreFeatures: [
      {
        name: '移动审批',
        description: '随时随地处理审批流程，提升办公效率',
        icon: 'MobilePhone'
      },
      {
        name: '视频会议',
        description: '高清视频会议，支持屏幕共享和录制',
        icon: 'Monitor'
      },
      {
        name: '文档协作',
        description: '多人实时协作编辑，版本管理',
        icon: 'Setting'
      },
      {
        name: '智能考勤',
        description: 'GPS定位打卡，智能排班管理',
        icon: 'DataAnalysis'
      }
    ],
    techSpecs: [
      { name: '支持平台', value: 'iOS/Android' },
      { name: '离线功能', value: '支持' },
      { name: '数据同步', value: '实时同步' },
      { name: '安全等级', value: '企业级' }
    ],
    pricingPlans: [
      {
        name: '个人版',
        price: 99,
        period: '月',
        features: ['基础办公功能', '5G存储空间', '10人团队', '邮件支持'],
        buttonText: '免费试用',
        recommended: false
      },
      {
        name: '团队版',
        price: 299,
        period: '月',
        features: ['完整办公功能', '100G存储空间', '100人团队', '视频会议', '电话支持'],
        buttonText: '立即购买',
        recommended: true
      }
    ]
  }
]

// 计算属性
const filteredProducts = computed(() => {
  let result = products

  // 分类筛选
  if (selectedCategory.value !== 'all') {
    result = result.filter(product => product.categoryId === selectedCategory.value)
  }

  // 搜索筛选
  if (searchKeyword.value) {
    const keyword = searchKeyword.value.toLowerCase()
    result = result.filter(product => 
      product.name.toLowerCase().includes(keyword) ||
      product.description.toLowerCase().includes(keyword) ||
      product.features.some(feature => feature.toLowerCase().includes(keyword))
    )
  }

  // 排序
  switch (sortBy.value) {
    case 'latest':
      result = result.sort((a, b) => b.id - a.id)
      break
    case 'popular':
      result = result.sort((a, b) => b.reviews - a.reviews)
      break
    case 'price-asc':
      result = result.sort((a, b) => a.price - b.price)
      break
    case 'price-desc':
      result = result.sort((a, b) => b.price - a.price)
      break
  }

  return result
})

// 方法
const selectCategory = (categoryId: string) => {
  selectedCategory.value = categoryId
}

const handleSearch = () => {
  // 搜索逻辑已在计算属性中处理
}

const viewProductDetail = (productId: number) => {
  const product = products.find(p => p.id === productId)
  if (product) {
    selectedProduct.value = product
    showProductDetail.value = true
    // 更新URL参数
    router.push({ query: { ...route.query, productId: productId.toString() } })
  }
}

const tryProduct = (productId: number) => {
  console.log('试用产品:', productId)
  // 试用逻辑
}

const getCategoryName = (categoryId: string) => {
  const category = productCategories.find(c => c.id === categoryId)
  return category?.name || '未知分类'
}

const selectPlan = (plan: any) => {
  console.log('选择方案:', plan)
  // 选择方案逻辑
}

const contactSales = () => {
  router.push('/contactus')
}

// 监听路由变化
watch(() => route.query.productId, (productId) => {
  if (productId) {
    const product = products.find(p => p.id === parseInt(productId as string))
    if (product) {
      selectedProduct.value = product
      showProductDetail.value = true
    }
  }
}, { immediate: true })

// 初始化
onMounted(() => {
  // 如果URL中有productId参数，直接显示产品详情
  const productId = route.query.productId
  if (productId) {
    viewProductDetail(parseInt(productId as string))
  }
})
</script>

<style scoped>
.product-page {
  min-height: 100vh;
}

/* 页面头部 */
.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 8rem 0 4rem;
  color: white;
  text-align: center;
}

.page-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.page-description {
  font-size: 1.2rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* 产品分类 */
.product-categories {
  padding: 3rem 0;
  background: white;
  border-bottom: 1px solid #e2e8f0;
}

.category-tabs {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.category-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.category-tab:hover,
.category-tab.active {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
  color: #667eea;
}

.tab-icon {
  font-size: 1.2rem;
}

.tab-name {
  font-weight: 500;
}

.tab-count {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* 产品区域 */
.products-section {
  padding: 4rem 0;
  background: #f8fafc;
}

/* 搜索筛选 */
.products-filter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  gap: 2rem;
}

.search-box {
  flex: 1;
  max-width: 400px;
}

.filter-options {
  display: flex;
  gap: 1rem;
}

/* 产品网格 */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.product-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.product-image {
  position: relative;
  height: 200px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badges {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.badge {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge.hot {
  background: #ff4757;
  color: white;
}

.badge.recommended {
  background: #ffa502;
  color: white;
}

.product-content {
  padding: 1.5rem;
}

.product-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.product-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #333;
  margin: 0;
}

.product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rating-text {
  font-size: 0.9rem;
  color: #666;
}

.product-description {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.product-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.feature-tag {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
}

.more-features {
  background: #f1f5f9;
  color: #64748b;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-price {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.price-label {
  font-size: 0.9rem;
  color: #666;
}

.price-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #667eea;
}

.price-unit {
  font-size: 0.9rem;
  color: #666;
}

.product-actions {
  display: flex;
  gap: 0.5rem;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 4rem 0;
}

/* 产品详情弹窗 */
.product-detail {
  max-height: 80vh;
  overflow-y: auto;
}

.detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.product-gallery {
  text-align: center;
}

.main-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.thumbnail-list {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.thumbnail:hover {
  border-color: #667eea;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.category-tag {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
}

.product-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
}

.product-summary {
  color: #666;
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* 核心功能 */
.core-features {
  margin-bottom: 2rem;
}

.features-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
}

.features-list {
  display: grid;
  gap: 1rem;
}

.feature-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.feature-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: #333;
}

.feature-desc {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* 技术规格 */
.tech-specs {
  margin-bottom: 2rem;
}

.specs-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
}

.specs-grid {
  display: grid;
  gap: 0.8rem;
}

.spec-item {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem;
  background: #f8fafc;
  border-radius: 8px;
}

.spec-name {
  font-weight: 500;
  color: #333;
}

.spec-value {
  color: #667eea;
  font-weight: 500;
}

/* 价格方案 */
.pricing-plans {
  margin-bottom: 2rem;
}

.pricing-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #333;
}

.plans-grid {
  display: grid;
  gap: 1rem;
}

.plan-card {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.plan-card.recommended {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.02);
  position: relative;
}

.plan-card.recommended::before {
  content: '推荐';
  position: absolute;
  top: -10px;
  right: 20px;
  background: #667eea;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
}

.plan-header {
  margin-bottom: 1rem;
}

.plan-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.price {
  font-size: 1.8rem;
  font-weight: 700;
  color: #667eea;
}

.period {
  color: #666;
}

.plan-features {
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

.plan-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  color: #666;
}

.plan-features li .el-icon {
  color: #67c23a;
}

.plan-button {
  width: 100%;
}

.dialog-footer {
  text-align: right;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .detail-content {
    grid-template-columns: 1fr;
  }

  .category-tabs {
    gap: 1rem;
  }

  .products-filter {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: none;
  }
}

@media (max-width: 768px) {
  .page-title {
    font-size: 2rem;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .category-tabs {
    flex-direction: column;
    align-items: center;
  }

  .product-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .product-footer {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .product-actions {
    width: 100%;
    justify-content: space-between;
  }
}
</style>